<?php
	header('Content-Type:text/html;charset=utf-8');
	session_start();	
	$userid = $_SESSION['userid'];	
	$cid = $_GET['cid'];
	if($cid==null||$cid==""){
		$cid = $_SESSION['cid'];
	}
	$sid = $_GET['sid'];
	if($sid==null||$sid==""){
		$sid = $_SESSION['sid'];
	}	
	if($userid!=null&&$userid!=""){	
		require_once("db_manage.php");
		$sid = $_POST['sid'];
		$title = $_POST['title'];
		$content = $_POST['content'];
		if(sight_update($sid, $title, $content, $userid, $cid)==1){		
			$_SESSION['cid'] = $cid;
			$_SESSION['sid'] = $sid;
			echo "<script>location.href='admin_sight_over.php';</script>";
		}else{
			echo "<font color=red>update sight wrong</font>";
		}		
	}
?>
